package com.springboot.redis.service;


import com.springboot.redis.bean.Student;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

/**
 * @ClassName StudentService
 * @Description TODO
 * @Author peter
 * @Date 19-4-15 下午2:55
 * @Version 1.0
 **/
@CacheConfig(cacheNames = "student")
public interface StudentService {

    int add(Student student);

    @CachePut(key = "#p0.sno")
    int update(Student student);

    @CacheEvict(key = "#p0", allEntries = true)
    int deleteBysno(String sno);

    @Cacheable(key = "#p0")
    Student queryStudentBySno(Integer sno);
}
